# Copyright 2021, Régis Décamps
# SPDX-License-Identifier: BSD-3-Clause

load("@jflex_rules//jflex:jflex.bzl", "jflex")
load("//scripts:check_deps.bzl", "check_deps")

check_deps(
    name = "deps_to_bootstrap_jflex_test",
    prohibited = "@jflex_rules//jflex:jflex_bin",
)

java_test(
    name = "LargeInputTest",
    size = "small",
    srcs = [
        "LargeInputTest.java",
    ],
    deps = [
        ":large_input_scanner",
        ":repeat_content_reader",
        "//third_party/com/google/guava",
        "//third_party/com/google/truth",
    ],
)

java_library(
    name = "large_input_scanner",
    srcs = [
        "NegativeYyCharException.java",
        "State.java",
        ":gen_large_input_scanner",
    ],
    deps = [
        "//third_party/com/google/guava",
    ],
)

jflex(
    name = "gen_large_input_scanner",
    srcs = ["large_input.flex"],
    jflex_bin = "//jflex:jflex_bin",
    outputs = ["LargeInputScanner.java"],
)

java_library(
    name = "repeat_content_reader",
    testonly = True,
    srcs = ["RepeatContentReader.java"],
    deps = [
        "//third_party/com/google/guava",
    ],
)

java_test(
    name = "RepeatContentReaderTest",
    size = "small",
    srcs = ["RepeatContentReaderTest.java"],
    deps = [
        ":repeat_content_reader",
        "//third_party/com/google/guava",
        "//third_party/com/google/truth",
    ],
)
